<?php
class Upload{



// Class en cours de débuguage

	function __construct($destination, $extensions = array('png','jpg','jpeg')) {
 		if (!isset($_FILES) OR $_FILES[$index]['error'] > 0) {
			echo "ok1";
		}else {
			echo "pas ok1";
		}
		$ext = substr(strrchr($_FILES['name'],'.'),1);
		if ($extensions !== FALSE AND !in_array($ext,$extensions)) {
			echo "ok3";
		}else {
			echo "pas ok3";
		}
		if(move_uploaded_file($_FILES['tmp_name'],$destination)) {
			echo "Upload réussi";
		}else {
			echo "Echec de l'upload";
		}
	}
}

?>
